package team.future.joke.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import team.future.joke.entity.WeixinConfig;

/**
 * Title: WeixinDaoImpl.java<br>
 * Description: <br>
 * Copyright (c) 未来工作室版权所有 2015    <br>
 * Create DateTime: 2015年9月21日 下午6:48:17 <br>
 * @author futurezhu
*/
@Service("weixinDao")
public class WeixinDaoImpl extends BaseMongoDaoImpl<WeixinConfig> {
	@Autowired
	private MongoOperations mongoTemplate;

	@Override
	public void insertObject(WeixinConfig config) {
		mongoTemplate.insert(config);
	}

	@Override
	public WeixinConfig getObject(Query query) {
		return mongoTemplate.findOne(query, WeixinConfig.class);
	}

	@Override
	public void deleteObject(Query query) {
		mongoTemplate.remove(query, WeixinConfig.class);
	}

}
